<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Function</title>
  <script>

      //示例一
      alert(sum(10, 20));//30
      function sum(num1, num2) {
          return num1 + num2;
      }

      //示例二
      alert(sum2(10, 20));//报错
      let sum2 = function (num1, num2) {
          return num1 + num2;
      };


  </script>
</head>
<body>
函数声明与函数表达式
</body>
</html>